//
//  Myshoucangde_ViewController.m
//  OpenYooxi_IOS
//
//  Created by YeahYes on 15/3/19.
//  Copyright (c) 2015年 com.ivyvi.ee. All rights reserved.
//

#import "Myshoucangde_ViewController.h"
#import "MyShoucangde_TableViewCell.h"


static NSString *identify = @"Cell";

@interface Myshoucangde_ViewController ()

@end

@implementation Myshoucangde_ViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed = YES;
        
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"我的收藏";
    
    
    //2.第二种创建方式
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftButton.frame = CGRectMake(0, 0, 10, 20);
    [leftButton setImage:[UIImage imageNamed:@"2_03"]
                forState:UIControlStateNormal];
    [leftButton addTarget:self action:@selector(leftAction:)
         forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton];
    self.navigationItem.leftBarButtonItem = leftItem;
    
    
    _shouchangtableview.dataSource = self;
    _shouchangtableview.delegate = self;
    //    _ShouChangTableview.pagingEnabled = YES;
    _shouchangtableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    //取消tableview右侧的滑动条
    _shouchangtableview.showsVerticalScrollIndicator = NO;
    _shouchangtableview.backgroundColor = [UIColor whiteColor];
    
    
    //注册uitableviewcell
    UINib *nib = [UINib nibWithNibName:@"MyShoucangde_TableViewCell" bundle:[NSBundle mainBundle]];
    [_shouchangtableview registerNib:nib forCellReuseIdentifier:identify];

}



#pragma mark - UITableView delegate 设置单元格高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 100;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    MyShoucangde_TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//    TianXieDingDan_ViewController *tianxiedingdan = [[TianXieDingDan_ViewController alloc] initWithNibName:@"TianXieDingDan_ViewController" bundle:nil];
//    [self.navigationController pushViewController:tianxiedingdan animated:YES];
    
}






- (void)leftAction:(UIButton *)button {
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
